<template>
    <div>
        <ul>
            <li v-for="(item, i) in list" :key="i">
                <span>{{ i + 1 }}</span>
                <span>{{ item }}</span>
                <span @click="del(i)">X</span>
            </li>
        </ul>
    </div>
</template>

<script>
export default {
    props: {
        list: Array,
    },
    methods: {
        del(i) {
            this.$emit("del", i);
        },
    },
};
</script>

<style scoped>
li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 400px;
    list-style: none;
}
</style>
